Demo Laser 2D

The demo will produce the result shown in the image below:

../../_images/wolf-demo-laser.png

The WOLF ROS demo laser 2d: rendered maps in pointcloud and occupancy grid forms, with the factor graph showing motion factors in yellow, and loop closures in green.

ROS2

This demo is based on ROS2. We recommend installing the desktop-full version compatible with your ubuntu distribution.

This demo requires that a ROS2 workspace is already set up and sourced.

Required WOLF plugins

Make sure that you have installed the following WOLF plugins (and their dependencies):

Required WOLF ROS2 packages

  1. Clone the WOLF ROS2 node:

    cd ${ROS_WS}/src
    git clone -b main https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_ros2/wolf_ros2_node.git
    
  2. Clone the wolf_ros2_laser package:

    cd ${ROS_WS}/src
    git clone -b main https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_ros2/wolf_ros2_laser.git
    

    This package contains the subscriber for the laser scan and publishers for different types of laser-based maps.

Clone & launch the demo

  1. Clone the WOLF ROS demo Laser 2D:

    cd ${ROS_WS}/src
    git clone https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_ros2/demos/wolf_ros2_demo_laser2d.git
    
  2. Compile:

    cd ..
    colcon build --symlink-install --packages-up-to wolf_ros2_demo_laser2d
    

    The following ros2 bags will be automatically downloaded: basic, advanced and turtlebot.

  3. Launch the demo specifying the rosbag using the argument bag (default is advanced):

    ros2 launch wolf_ros2_demo_laser2d demo_laser2d.launch.py bag:=advanced
    

Troubleshooting

When launching the demo, you may experience a runtime error of type what(): Couldn't load resource with path xxxxxx.so. To resolve this, you may need to update the cache for the linker:

sudo ldconfig

No outputs are printed. Now, try to launch again the demo.